package org.byqh.dqeai.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.byqh.dqeai.common.Json;
import org.byqh.dqeai.entity.SoftBusinessCategory;
import org.byqh.dqeai.entity.proxy.SoftBusinessCategoryProxy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/softBusinessCategory")
@Tag(name = "系统[SoftBusinessCategory] - 软件业务分类管理")
public class SoftBusinessCategoryController
        extends BaseOpController<SoftBusinessCategory, SoftBusinessCategoryProxy> {
    /**
     * 按SystemId查询数据。
     */
    @GetMapping("listBySystemId")
    public Json<List<SoftBusinessCategory>> listBySystemId(
            @RequestParam String systemId) {

        return this.listImpl(SoftBusinessCategory.class, query -> {
            return query.where(o -> o.systemId().eq(systemId));
        });
    }
}